const http = require('http')
const querystring = require('querystring')

http.createServer(function(req, res) {
    
    var i = 0 
    var rs = ''
    req.on('data', function(data) {
        console.log(`第${i++}次`)
        rs+= data
    })
    req.on('end', function() {
        var POST = querystring.parse(rs)
        console.log(POST)
    })

    res.write('this is response')
    res.end()
}).listen(8080)